// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HelperBlueprintFunctionLibrary.generated.h"

/**
 *
 */
UCLASS()
class ROBOTSIMULATOR_API UHelperBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()

public:

    UFUNCTION(BlueprintPure, Category = "Base|UnixTimestamp")
        static FDateTime UnixTimestampToDateTime(int64 UnixTime);

    UFUNCTION(BlueprintPure, Category = "Base|UnixTimestamp")
        static int64 DateTimeToUnixTimestamp(FDateTime Time);

    UFUNCTION(BlueprintCallable, Category = "Base|Regex")
        static bool RegexMatch(const FString& Str, const FString& Pattern, TArray<FString>& Result);

    UFUNCTION(BlueprintCallable, Category = "Base|File")
        static void ScanDirectory(TArray<FString>& Files, const FString& FilePath, const FString& Extension);

    UFUNCTION(BlueprintCallable, Category = "Base|File")
        static void GetAvailableKeys(TSet<FString>& Keys);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "ToTexturePath", keywords = "Load"), Category = "LoadFile")
        static FString ToTexturePath(const FString& Key);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "ToMaterialPath", keywords = "Load"), Category = "LoadFile")
        static FString ToMaterialPath(const FString& Key);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "PathToKey", keywords = "Load"), Category = "LoadFile")
        static FString PathToKey(const FString& Key);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "ButtonNameToKey", keywords = "Load"), Category = "LoadFile")
        static FString ButtonNameToKey(const FString& BtnName);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "LoadTextureFromPath", keywords = "Load"), Category = "LoadFile")
        static UTexture2D* LoadTextureFromPath(const FString& Path);

    UFUNCTION(BlueprintCallable, meta = (DisplayName = "LoadMaterialFromPath", keywords = "Load"), Category = "LoadFile")
        static UMaterial* LoadMaterialFromPath(const FString& Path);
};
